package com.controller;

import com.baomidou.mybatisplus.core.metadata.IPage;
import com.pojo.Product;
import com.pojo.ProductOrder;
import com.service.ProductService;
import com.vo.R;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

/**
 * @author lifeng
 * @create 2022-11-28 23:39
 */
@RestController
@RequestMapping("/product")
@CrossOrigin
public class ProductController {

    @Autowired
    protected ProductService productService;

    @GetMapping("/selectPageByTypeId/{page}/{limit}/{typeid}")
    public R selectPageByTypeId(@PathVariable Long page,
                                @PathVariable Long limit,
                                @PathVariable Long typeid){

        IPage<Product> productIPage = productService.selectPageByTypeId(page, limit, typeid);
        return R.ok().data("productIPage",productIPage);
    }


}
